import React from 'react'
import { connect } from 'react-redux'

import Navbar from '../../components/Navbar'
import HouseList from '../../components/HouseList'

import './index.scss'

export default connect(state=>({records:state.record}))(function Record(props) {

  const {records,history}=props

  const empty=<div className='record-empty'><span>浏览记录为空...</span></div>

  return (
    <div>
      <div className='record-navbar'>
        <Navbar title='看房记录'></Navbar>
      </div>
      <div className='record-list'>
        {
          records.length===0?empty:
          <HouseList list={records} history={history}></HouseList>
        }
        
      </div>

      
    </div>
  )
})
